<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 40%;
            height: 200px;
            border-radius: 15px;
            box-shadow: 0 0 3px 3px rgb(253, 192, 134);
            transform: translate(-50%, -50%);
            line-height: 200px;
            text-align: center;
        }
    </style>
</head>

<body>
    <div>

    </div>
    <script>
        var div = document.querySelector('div');
        var i = 5;
        ymtz();
        setInterval(ymtz, 1000);

        function ymtz() {
            i--;
            div.innerHTML = i + '秒之后跳转回首页';
            if (i == 0) {
                location.href = 'index.html';
            }
        }
    </script>
</body>

</html>